package com.zhuiyun.educations.api.sysmenuback.controller;

import com.zhuiyun.educations.api.sysmenuback.entiy.SysDict;
import com.zhuiyun.educations.api.sysmenuback.service.SysDictService;
import com.zhuiyun.educations.common.response.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName SysDictController
 * @Description TODO
 * @Author MJL
 * @Date 2023/6/23 8:40
 **/
@RestController
@RequestMapping("/Dict")
public class SysDictController {
    @Resource
    SysDictService sysDictService;
    /**
    * @Author MJL
    * @Description todo 下拉菜单（图标）
    * @Date 2023/6/23 8:42
    * @Return  * @param null
    */
    @GetMapping("/SysSelectDict")
    public CommonResult SysSelectDict(String sysType){
        List<SysDict> list = sysDictService.SysSelectDict(sysType);
        if (list != null){
            return CommonResult.ok(list);
        }else {
            return CommonResult.error(9999,"菜单图标获取失败");
        }
    }
}
